#{extends 'mainStage.html' /}

#{set title:'Gestion des candidatures' /}

#{if !stages.isEmpty()}
    <div class="post">
        <div class="post">
            <h2 class="post-title">
                Liste des stages
            </h2>
            <br>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="liste"> 
        		<thead>
        			<tr>
        				<th>Intitule</th>	
        				<th>Date de D&eacute;but</th>
        				<th>Dur&eacute;e</th>
        				<th>Structure Organisatrice</th>
        				<th>Lieu</th>
        				<th>Etat</th>
        				<th>Inscrit</th>
        				<th>Liste d'Attente</th>
        				<th>Annul&eacute;</th>
        				<th>Jury</th>
        				<th>Formateur</th>
        				<th>Candidatures</th>
        			</tr>
        		</thead>		

                <tbody>
        	    #{list items:stages, as:'stage' } 
        	       <tr>
        	            <td><a href="@{Stages.detailStage(stage.id)}">${stage.intitule}</a></td>
        	            <td> 
                            #{if stage.dateDeb == null}
                                -
        	                #{/if}
                            #{else}
        	                    ${stage.dateDeb.format('dd MMMM yyyy', 'fr')}
                            #{/else}
        	            </td>
        	            <td>${stage.duree}</td>
        	            <td>${stage.structure}</td>
        	            <td> 
                            #{if stage.cis == null}
                                -
        	                #{/if}
                            #{else}
        	                    ${stage.cis}
                            #{/else}
        	            </td>
        	            <td>${stage.etat}</td>
        	            <td>${stage.getEffectif()} / ${stage.effectifMax}</td>
        	            <td>${stage.getEffectifListeAttente()}</td>
        	            <td>${stage.getEffectifAnnule()}</td>
        	            <td>${stage.getNombreJury()}</td>
        	            <td>${stage.getNombreFormateur()}</td>
        	           <td>
        	               <a href="@{Candidats.gerer(stage.id)}">G&eacute;rer</a> |
           	               <a href="@{Candidats.ajouterCandidature(stage.id)}">Ajouter</a>
        	               
        	           </td>
        	       </tr>
        	       
        	       
        	    #{/list}
        	    </tbody>
        	</table>
        </div>
    </div>    
#{/if}
 
#{else}
    <div class="empty">
        Il n'y a pas de candidatures enregistr&eacute;es.
    </div>
#{/else}
